package studia.figlewicz.dao.ejb;

// Generated 2011-06-03 08:31:30 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Platnosc generated by hbm2java
 */
@Entity
@Table(name = "PLATNOSC", schema = "MARCIN")
public class Platnosc implements java.io.Serializable {

	private PlatnoscId id;
	private Nogainstrumentu nogainstrumentu;
	private BigDecimal nominal;
	private BigDecimal prawdopodobienstwo;
	private BigDecimal wartoscwarunkowadolna;
	private BigDecimal wartoscwarunkowagorna;
	private Set<Wycenaplatnosci> wycenaplatnoscis = new HashSet<Wycenaplatnosci>(
			0);

	public Platnosc() {
	}

	public Platnosc(PlatnoscId id, Nogainstrumentu nogainstrumentu) {
		this.id = id;
		this.nogainstrumentu = nogainstrumentu;
	}

	public Platnosc(PlatnoscId id, Nogainstrumentu nogainstrumentu,
			BigDecimal nominal, BigDecimal prawdopodobienstwo,
			BigDecimal wartoscwarunkowadolna, BigDecimal wartoscwarunkowagorna,
			Set<Wycenaplatnosci> wycenaplatnoscis) {
		this.id = id;
		this.nogainstrumentu = nogainstrumentu;
		this.nominal = nominal;
		this.prawdopodobienstwo = prawdopodobienstwo;
		this.wartoscwarunkowadolna = wartoscwarunkowadolna;
		this.wartoscwarunkowagorna = wartoscwarunkowagorna;
		this.wycenaplatnoscis = wycenaplatnoscis;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "kodumowy", column = @Column(name = "KODUMOWY", nullable = false, length = 20)),
			@AttributeOverride(name = "stronanogi", column = @Column(name = "STRONANOGI", nullable = false, length = 6)),
			@AttributeOverride(name = "terminplatnosci", column = @Column(name = "TERMINPLATNOSCI", nullable = false, length = 5)),
			@AttributeOverride(name = "typplatnosci", column = @Column(name = "TYPPLATNOSCI", nullable = false, length = 14)) })
	public PlatnoscId getId() {
		return this.id;
	}

	public void setId(PlatnoscId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "KODUMOWY", referencedColumnName = "KODUMOWY", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "STRONANOGI", referencedColumnName = "STRONANOGI", nullable = false, insertable = false, updatable = false) })
	public Nogainstrumentu getNogainstrumentu() {
		return this.nogainstrumentu;
	}

	public void setNogainstrumentu(Nogainstrumentu nogainstrumentu) {
		this.nogainstrumentu = nogainstrumentu;
	}

	@Column(name = "NOMINAL", precision = 24, scale = 12)
	public BigDecimal getNominal() {
		return this.nominal;
	}

	public void setNominal(BigDecimal nominal) {
		this.nominal = nominal;
	}

	@Column(name = "PRAWDOPODOBIENSTWO", precision = 24, scale = 12)
	public BigDecimal getPrawdopodobienstwo() {
		return this.prawdopodobienstwo;
	}

	public void setPrawdopodobienstwo(BigDecimal prawdopodobienstwo) {
		this.prawdopodobienstwo = prawdopodobienstwo;
	}

	@Column(name = "WARTOSCWARUNKOWADOLNA", precision = 24, scale = 12)
	public BigDecimal getWartoscwarunkowadolna() {
		return this.wartoscwarunkowadolna;
	}

	public void setWartoscwarunkowadolna(BigDecimal wartoscwarunkowadolna) {
		this.wartoscwarunkowadolna = wartoscwarunkowadolna;
	}

	@Column(name = "WARTOSCWARUNKOWAGORNA", precision = 24, scale = 12)
	public BigDecimal getWartoscwarunkowagorna() {
		return this.wartoscwarunkowagorna;
	}

	public void setWartoscwarunkowagorna(BigDecimal wartoscwarunkowagorna) {
		this.wartoscwarunkowagorna = wartoscwarunkowagorna;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "platnosc")
	public Set<Wycenaplatnosci> getWycenaplatnoscis() {
		return this.wycenaplatnoscis;
	}

	public void setWycenaplatnoscis(Set<Wycenaplatnosci> wycenaplatnoscis) {
		this.wycenaplatnoscis = wycenaplatnoscis;
	}

}
